package com.jiangruan.javaApiProject.packagIng;

import bean.FunnyPeople;
import bean.HotVideo;
import com.jiangruan.javaApiProject.address.BitCoinAddres;
import com.jiangruan.javaApiProject.bean.bean.*;
import com.jiangruan.javaApiProject.service.*;


import java.util.List;
import java.util.Scanner;

/**
 * @Author 默
 * @Date 2021/12/29
 * @Time 20:09
 * @desc
 * @Description
 */
public class menu {
    public static void main(String[] args) {


        while (true){
            System.out.println("========此时进行老于项目总测试========");
            System.out.println("1.视频数据类");
            System.out.println("2.RPC请求类");
            System.out.println("3.原始密钥推导");
            System.out.println("4.退出");
            Scanner sc = new Scanner(System.in);

            System.out.println("请输入项目id");

            int num = sc.nextInt();

            run(num);

            if (num == 4)
                break;





        }

    }
    public static void run(int num){




        switch (num){
            case 1:
                API();
                break;
            case 2:
                RPC();
                break;
            case 3:
                InferOriginPubKeyAddress();
                break;
            default:
                System.out.println("请输入正确ID");
                break;

        }
    }
    public static void API(){
        System.out.println("======欢迎使用视频数据类======");
        System.out.println("请选择： 1.热门视频榜");
        System.out.println("         2.搞笑达人榜 ");
        System.out.println("         3.游戏达人榜 ");
        System.out.println("         4.美食达人榜 ");
        System.out.println("         5.汽车达人榜 ");
        System.out.println("         6.体育达人榜 ");
        System.out.println("         7.二次元达人榜 ");
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入视频ID");

        int num = sc.nextInt();

        switch (num){
            case 1:
                List<HotVideo> hotVideo = HotVideoService.getHotVideo();

                System.out.println(hotVideo);
                break;
            case 2:
                List<FunnyPeople> funnyPeople = FunnyPeopleService.getFunnyPeople();

                System.out.println(funnyPeople);
                break;
            case 3:
                List<GamePerson> gamePerson = GamePersonService.getGamePerson();

                System.out.println("游戏达人榜："+gamePerson);
                break;
            case 4:
                List<DeliciousFood> deliciousFood = DeliciousFoodService.getDeliciousFood();

                System.out.println("美食达人榜：" + deliciousFood);
                break;
            case 5:
                List<CarPersonCommon> carPerson = CarPersonService.getCarPerson();

                System.out.println("汽车达人榜：" + carPerson);
                break;
            case 6:
                List<SporPersontCommon> sportPerson = SportPersoService.getSportPerson();

                System.out.println("汽车达人榜：" + sportPerson);
                break;
            case 7:
                List<SecondaryPersonCommon> secondaryPerson = SecondaryPersonService.getSecondaryPerson();

                System.out.println("汽车达人榜：" + secondaryPerson);
                break;
                default:
                    System.out.println("请输入正确的ID");
                    break;

        }
    }
    public static void RPC(){

        System.out.println("======欢迎使用RPC服务======");
        System.out.println("请选择服务ID: 1 getBestBlockHash");
        System.out.println("              2 getBlockChainInfo");
        System.out.println("              3 getBlockCount");
        System.out.println("              4 getChainTips");
        System.out.println("              5 getDifficulty");
        System.out.println("              6 getMemPoolInfo");
        System.out.println("请输入服务ID");

        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();

        switch (num){
            case 1:
                String bestBlockHash = GetBestBlockHashService.getBestBlockHash();

                System.out.println("getBestBlockHash: "+bestBlockHash);
                break;
            case 2:
                String getblockchaininfo = GetBlockChainInfoService.getblockchaininfo();

                System.out.println("getblockchaininfo"+getblockchaininfo);
                break;
            case 3:
                String getblockcount = GetBlockCountservice.getblockcount();

                System.out.println(getblockcount);
                break;
            case 4:
                String getchaintips = GetChainTipsService.getchaintips();

                System.out.println(getchaintips);
                break;
            case 5:
                String getdifficulty = GetDifficultyService.getdifficulty();

                System.out.println(getdifficulty);
                break;
            case 6:
                break;
                default:
                    System.out.println("请输入正确的ID");
                    break;
        }
    }
    public static void InferOriginPubKeyAddress(){
        System.out.println("======欢迎使用原始密钥推导======");
        BitCoinAddres bitCoinAddres = new BitCoinAddres();

        String s = bitCoinAddres.newAddress(bitCoinAddres.Generatekey());

        System.out.println("原始密钥地址为："+s);
    }
}
